﻿using Core.Helper;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace Core
{
   public abstract class Option<T>: Order<T>
    {
        public virtual Option<T> Where(Expression<Func<T, bool>> predicate,bool IsDelete=false)
        {
            SetContext = new Core.Model.SetContext();

            //默认 去掉不要删除的数据
            if (!IsDelete)
            {
                predicate = predicate.And(CreateEqualityExpressionForIsDelete(false));
            }
            SetContext.WhereExpression = predicate;
            return this;
        }
    }
}
